const path = require('path');
const HtmlWebpackPlugin = require('html-webpack-plugin');
 module.exports = {
   entry: './src/index.js',
   output: {
    filename: 'main.js',
    filename: 'bundle.js',
     path: path.resolve(__dirname, 'dist'),
   },
   plugins: [
    new HtmlWebpackPlugin({
      title: '管理输出',
    }),
  ],
   module: {
    rules: [
      {
        test: /\.css$/i,
        use: ['style-loader', 'css-loader'],
      },
      {
        test: /\.(png|svg|jpg|jpeg|gif)$/i,
        type: 'asset/resource',
      },
      {
        test: /\.styl$/,
        use: ['style-loader', 'css-loader' ,'stylus-loader'],
      },
    ],
  },
  devServer: {
    host: "localhost", // 启动服务器域名
    port: "3030", // 启动服务器端口号
    open: true, // 是否自动打开浏览器
  },
  mode:'development'
 };